package org.example;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@SpringBootApplication
@RestController
public class Application {
    public static void main(String[] args) {
        SpringApplication.run(Application.class,args);
    }
    @Autowired
    ConfigurableApplicationContext applicationContext;

    @Value("${common:name}")
    private String config2;
    @GetMapping("/configs")
    public String getConfigs(){
        //return config2;
        return applicationContext.getEnvironment().getProperty("common.name");
    }
    @Value("1")
    public final  boolean  isBs(){
        return true;
    }

    public void sss(){
        System.out.println("你好");
    }

    public void ssf(){
        System.out.println("fff");
    }
}
